package com.cqie.controller;

import com.cqie.dto.DepartmentInfoDto;
import com.cqie.entity.DepartmentInfo;
import com.cqie.service.IDepartmentInfoService;
import com.cqie.util.ResultTemplate;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 科室信息 前端控制器
 * </p>
 *
 * @author 不吃海鲜
 * @since 2024-12-30
 */

@Tag(name = "科室管理Controller", description = "描述：科室接口")
@Slf4j
@RestController
@RequestMapping({"/api/v1.0/departmentInfo", "/api/v1/departmentInfo"})
public class DepartmentInfoController {

    private final IDepartmentInfoService departmentInfoService;

    public DepartmentInfoController(IDepartmentInfoService departmentInfoService) {
        this.departmentInfoService = departmentInfoService;
    }

    @Operation(summary = "查询科室List")
    @Parameters({
            @Parameter(name = "likeQuery", description = "科室名称/科室编码"),
    })
    @GetMapping("/getDepartmentInfoList")
    public ResultTemplate<List<DepartmentInfoDto>> getDepartmentInfoList(@RequestParam(required = false) String likeQuery){
        return ResultTemplate.Success(departmentInfoService.getDepartmentInfoList(likeQuery));
    }


}
